package com.secsbrain.engine.client.iface;

import com.secsbrain.common.ResponseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.secsbrain.engine.client.model.AbandonProcessParam;
import com.secsbrain.engine.client.model.ProcessDeal;
import com.secsbrain.engine.client.model.ProcessDto;
import com.secsbrain.engine.client.model.StartProcessParam;
import com.secsbrain.engine.client.model.SubmitRequest;

/**
 * 流程相关服务
 *
 * @author zhaoyi
 */
@FeignClient(value = "service-engine-${engine.env:dev}")
public interface ProcessService {
	
	/**
	 * 功能描述: <br>
	 * 启动流程
	 *
	 * @param  startProcessParam  启动流程参数
	 * @return 流程信息
	 */
	@RequestMapping(value = "/flow/start",method = RequestMethod.POST)
	ResponseVo<ProcessDto> startProcess(@RequestBody StartProcessParam startProcessParam);
	
	/**
	 * 功能描述: <br>
	 * 废弃流程
	 *
	 * @param  abandonProcessParam  废弃流程参数对象
	 * @return 流程实例ID
	 */
	@RequestMapping(value = "/flow/abandon",method = RequestMethod.POST)
	ResponseVo<String> abandon(@RequestBody AbandonProcessParam abandonProcessParam);
	
	/**
	 * 功能描述: <br>
	 * 任务审核通过
	 *
	 * @param  processDeal 流程处理参数
	 * @return 流程实例ID
	 */
	@RequestMapping(value = "/flow/pass",method = RequestMethod.POST)
	ResponseVo<String> pass(@RequestBody ProcessDeal processDeal);
	
	/**
	 * 功能描述: <br>
	 * 任务审核打回
	 *
	 * @param  processDeal 流程处理参数
	 * @return 流程实例ID
	 */
	@RequestMapping(value = "/flow/refuse",method = RequestMethod.POST)
	ResponseVo<String> refuse(@RequestBody ProcessDeal processDeal);
	
	/**
     * 功能描述: <br>
     * 提交申请
     *
     * @param  submitRequest  提交申请参数
     * @return 流程实例ID
     */
	@RequestMapping(value = "/flow/submitRequest", method = RequestMethod.POST)
 	ResponseVo<String> submitRequest(@RequestBody SubmitRequest submitRequest);
	
}
